Devices > Remote Devices > Device Template Files > Reference Methods > Basic and Advanced Reference Methods

Basic and Advanced Reference Methods

There are two different models for defining reference methods: basic and advanced. The basic model performs simple operations and is read/write. The advanced model performs very complex operations and is read only.

Basic Model Methods

The basic reference method model is identified by the attribute ref and uses attributes to perform operations. A basic reference method set to write could overwrite its source data group element (DataGroupElement) data if a user changes the basic reference method’s value.

Example

<BitPosA desc="Bit Position Method A" readOnly="true" type="ui2" ref="raw61" bPos="2"/>

Advanced Model Methods

The advanced reference method model is identified by the attribute isRef and uses reference operations to perform operations. It depends on one or more child elements ordered by precedence. An advanced reference method set to write does not overwrite its source data group element data if a user changes the advanced reference method’s value.

Example

<SubConst desc="Subtract Constant Value" readOnly="true" type="ui2" isRef="1">

<ref prec="0" refOp="opAssignId" deid="raw10"/>

<ref prec="1" refOp="opSubVal" value="5"/>

</SubConst>

Referencing Reference Methods

Reference methods may often – but not always – be used to reference other reference methods. Because of the additional complexity this implies, avoid this practice whenever possible.

Note: A basic reference method set to write could overwrite its source data group element data if a user changes the basic reference method’s value. An advanced reference method set to write does not overwrite its source data group element data if a user changes the advanced reference method’s value.

The following chart describes valid and invalid uses of reference methods that reference other reference methods.

  ...basic? ...advanced?

Basic can reference...

Yes

No

Advanced can reference...

Yes

Yes


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.